import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '设备状态',
    align: "center",
    dataIndex: 'status',
    width: 85
  },
  {
    title: '设备分类',
    align: "center",
    dataIndex: 'devType',
    width: 85
  
  },
  {
    title: '设备名称',
    align: "center",
    dataIndex: 'devName',
    width: 150
  },
  {
    title: '设备自编号',
    align: "center",
    dataIndex: 'devNumber',
    width: 110
  },
  {
    title: '规格型号',
    align: "center",
    dataIndex: 'devModel',
    width: 110
  },
  {
    title: '制造商国别',
    align: "center",
    dataIndex: 'country',
    width: 100
  },
  {
    title: '效用年限',
    align: "center",
    dataIndex: 'validity',
    width: 80
  },
  {
    title: '所属单位',
    align: "center",
    dataIndex: 'company',
    width: 100
  },

  {
    title: '班组',
    align: "center",
    dataIndex: 'team',
    width: 80
  },
  {
    title: 'ABC标识',
    align: "center",
    dataIndex: 'abcde',
    width: 80
  },
  {
    title: 'CMA设备',
    align: "center",
    dataIndex: 'cma',
    width: 80,
    customRender: ({ text }) => {
      return render.renderDict(text, 'yn');
    },
  },
  {
    title: '使用状态',
    align: "center",
    dataIndex: 'useStatus_dictText',
    width: 90
  },
  {
    title: '是否重点设备',
    align: "center",
    dataIndex: 'important',
    width: 105,
    customRender: ({ text }) => {
      return render.renderDict(text, 'yn');
    },
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "设备名称",
    field: 'devName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "设备自编号",
    field: 'devNumber',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "设备类型编码",
    field: 'devTypeCode',
    component: 'Input',
    colProps: { span: 6 },
  },
  // {
  //   label: "规格型号",
  //   field: 'devModel',
  //   component: 'Input',
  //   colProps: { span: 6 },
  // },
  {
    label: "设备状态",
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "dev_status"
    },
    colProps: { span: 6 },
  },
  {
    label: "设备状态",
    field: 'devType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "dev_type"
    },
    colProps: { span: 6 },
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '设备名称',
    field: 'devName',
    component: 'Input',
  },
  {
    label: '设备自编号',
    field: 'devNumber',
    component: 'Input',
  },
  {
    label: '设备类型编码',
    field: 'devTypeCode',
    component: 'Input',
  },
  {
    label: '规格型号',
    field: 'devModel',
    component: 'Input',
  },
  {
    label: '技术参数',
    field: 'params',
    component: 'Input',
  },
  {
    label: '设备状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "dev_status"
    },
  },
  {
    label: '制造商',
    field: 'producer',
    component: 'Input',
  },
  {
    label: '制造商国别',
    field: 'country',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: ""
    },
  },
  {
    label: '出厂编号',
    field: 'initialNumber',
    component: 'Input',
  },
  {
    label: '制造年月',
    field: 'produceDate',
    component: 'DatePicker',
  },
  {
    label: '投产日期',
    field: 'operationDate',
    component: 'DatePicker',
  },
  {
    label: '效用年限',
    field: 'validity',
    component: 'InputNumber',
  },
  {
    label: '资产原值',
    field: 'cost',
    component: 'InputNumber',
  },
  {
    label: '所属单位',
    field: 'company',
    component: 'Input',
  },
  {
    label: '期末累计折旧',
    field: 'totalDeprecition',
    component: 'InputNumber',
  },
  {
    label: '期末净值',
    field: 'netWorth',
    component: 'InputNumber',
  },
  {
    label: '年累折旧',
    field: 'yearDeprecition',
    component: 'InputNumber',
  },
  {
    label: '资产编号',
    field: 'assetNumber',
    component: 'Input',
  },
  {
    label: '存放地点',
    field: 'savePlace',
    component: 'Input',
  },
  {
    label: '设备保管人',
    field: 'custodian',
    component: 'Input',
  },
  {
    label: '班组',
    field: 'team',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "team"
    },
  },
  {
    label: 'ABCDE标识',
    field: 'abcde',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: ""
    },
  },
  {
    label: 'CMA设备',
    field: 'cma',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: ""
    },
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'Input',
  },
  {
    label: '设备分类',
    field: 'devType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: ""
    },
  },
  {
    label: '使用状态',
    field: 'useStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "use_status"
    },
  },
  // {
  //   label: '用途',
  //   field: 'useTo',
  //   component: 'Input',
  // },

  {
    label: '维保周期',
    field: 'checkCycle',
    component: 'InputNumber',
  },
  {
    label: '上次校准/维保时间',
    field: 'lastCheckDate',
    component: 'DatePicker',
  },
  // {
  //   label: '有效截止日期至',
  //   field: 'endCheckDate',
  //   component: 'DatePicker',
  // },
  // {
  //   label: '计划送检日期',
  //   field: 'planCheckDate',
  //   component: 'DatePicker',
  // },
  {
    label: '是否重点设备',
    field: 'important',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: ""
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
